package modellayer;

import java.util.ArrayList;

/**
 * The company class to create company objects
 * @author Allan Eriksen, Andreas Rye, Casper Madsen, Christian Stidsborg, Stefan Bols
 */

public class Company 
{
	private int cvr;
	private String name;
	private CompanyType companyType;
	private String address;
	private ZipCode zipCode;
	private String mainPhone;
	private String mainMail;
	private String website;
	private Service mainService;
	private Service secService;
	private int noOfEmployees;
	private long addedDate;
	private ArrayList<KeyPerson> keyPersonObj;
	private boolean isDummy;
	
	/**
	 * Company Fields
	 * @param cvr
	 * @param name
	 * @param companyType
	 * @param address
	 * @param zipCode
	 * @param mainPhone
	 * @param mainMail
	 * @param website
	 * @param mainService
	 * @param secService
	 * @param noOfEmployees
	 * @param addedDate
	 * @param keyPersonObj
	 * @param isDummy
	 * 
	 */
	
	/**
	 * Constructor for the Company class 
	 */
	public Company(int cvr, String name, CompanyType companyType, String address, ZipCode zipCode, String mainPhone, String mainMail, String website, Service mainService, Service secService, int noOfEmployees, long addedDate)
	{
		this.cvr = cvr;
		this.name = name;
		this.companyType = companyType;
		this.address = address;
		this.zipCode = zipCode;
		this.mainPhone = mainPhone;
		this.mainMail = mainMail;
		this.website = website;
		this.mainService = mainService;
		this.secService = secService;
		this.noOfEmployees = noOfEmployees;
		this.addedDate = addedDate;
		this.isDummy = false;
	}
	
	/**
	 * Company dummy for the Database layer
	 * @param cvr
	 */
	public Company(int cvr)
	{
		this.cvr = cvr;
		this.isDummy = true;
	}
	
	/**
	 * Set method for the keyPersonList
	 * Sets a keyPersonObject from the keyPerson ArrayList
	 * @param keyPersonObj
	 */
	public void setKPList(ArrayList<KeyPerson> keyPersonObj)
	{
		this.keyPersonObj = keyPersonObj;
	}
	
	/**
	 * Get method for the CompanyType
	 * @return companyType
	 */
	public CompanyType getCompanyType()
	{
		return this.companyType;
	}
	
	/**
	 * Set method for the companyType 
	 * @param companyType
	 */
	public void setCompanyType(CompanyType companyType)
	{
		this.companyType = companyType;
	}
	
	/**
	 * Get method for the cvr
	 * @return cvr
	 */
	public int getCvr() 
	{
		return cvr;
	}

	/**
	 * Set method for the cvr 
	 * @param cvr
	 */
	public void setCvr(int cvr) 
	{
		this.cvr = cvr;
	}

	/**
	 * Get method for the name
	 * @return name
	 */
	public String getName() 
	{
		return name;
	}

	/**
	 * Set method for the name 
	 * @param name
	 */
	public void setName(String name) 
	{
		this.name = name;
	}

	/**
	 * Get method for the address
	 * @return address
	 */
	public String getAddress() 
	{
		return address;
	}

	/**
	 * Set method for the address 
	 * @param address
	 */
	public void setAddress(String address) 
	{
		this.address = address;
	}

	/**
	 * Get method for the zipCode
	 * @return zipCode
	 */
	public ZipCode getZipCode() 
	{
		return this.zipCode;
	}

	/**
	 * Set method for the zipCode 
	 * @param zipCode
	 */
	public void setZipCode(ZipCode zipCode) 
	{
		this.zipCode = zipCode;
	}

	/**
	 * Get method for the mainPhone
	 * @return mainPhone
	 */
	public String getMainPhone() 
	{
		return mainPhone;
	}

	/**
	 * Set method for the mainPhone 
	 * @param mainPhone
	 */
	public void setMainPhone(String mainPhone) 
	{
		this.mainPhone = mainPhone;
	}

	/**
	 * Get method for the mainMail
	 * @return mainMail
	 */
	public String getMainMail() 
	{
		return mainMail;
	}

	/**
	 * Set method for the mainMail 
	 * @param mainMail
	 */
	public void setMainMail(String mainMail) 
	{
		this.mainMail = mainMail;
	}

	/**
	 * Get method for the website
	 * @return website
	 */
	public String getWebsite() 
	{
		return website;
	}

	/**
	 * Set method for the website 
	 * @param website
	 */
	public void setWebsite(String website) 
	{
		this.website = website;
	}

	/**
	 * Get method for the mainService
	 * @return mainService
	 */
	public Service getMainServices() 
	{
		return this.mainService;
	}

	/**
	 * Set method for the mainService 
	 * @param mainService
	 */
	public void setMainServices(Service mainService) 
	{
		this.mainService = mainService;
	}

	/**
	 * Get method for the secService
	 * @return secService
	 */
	public Service getSecServices() 
	{
		return secService;
	}

	/**
	 * Set method for the secService 
	 * @param secService
	 */
	public void setSecServices(Service secService) 
	{
		this.secService = secService;
	}

	/**
	 * Get method for the noOfEmployees
	 * @return noOfEmployees
	 */
	public int getNoOfEmployees() 
	{
		return noOfEmployees;
	}

	/**
	 * Set method for the noOfEmployees 
	 * @param noOfEmployees
	 */
	public void setNoOfEmployees(int noOfEmployees) 
	{
		this.noOfEmployees = noOfEmployees;
	}

	/**
	 * Get method for the addedDate
	 * @return addedDate
	 */
	public long getAddedDate() 
	{
		return addedDate;
	}

	/**
	 * Set method for the addedDate 
	 * @param addedDate
	 */
	public void setAddedDate(long addedDate) 
	{
		this.addedDate = addedDate;
	}
	
	/**
	 * Get method for the keyPersonObj, returns an object from the KeyPerson ArrayList
	 * @return keyPersonObj
	 */
	public ArrayList<KeyPerson> getKeyPersonObj() 
	{
		return keyPersonObj;
	}
	
	/**
	 * Add method for the keyPersonObj ArrayList
	 * @param newKeyPerson
	 */
	public void addKeyperson(KeyPerson newKeyPerson) 
	{
		keyPersonObj.add(newKeyPerson);
	}
	
	/**
	 * toString method, converts name to a string
	 * @return name
	 */
	@Override
    public String toString() {
        return this.name;
    }
}
